package com.wwwarehouse.resource_center.fragment.createobject.creategoods;

import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.view.View;

import com.wwwarehouse.resource_center.adapter.rules.MyPagerAdapter;
import com.wwwarehouse.resource_center.bean.goods.GoodsSelectLabelBean;
import com.wwwarehouse.resource_center.eventbus_event.RulesEvent;
import com.wwwarehouse.resource_center.fragment.base.MyBaseViewPagerFragment;

import java.util.ArrayList;
import java.util.List;

import de.greenrobot.event.EventBus;

/**
 * @author Joseph on 2017/9/23.
 *         <p/>
 *         已经选择的标签编辑
 */

public class GoodsLabelHaveChosenSelectParentFragment extends MyBaseViewPagerFragment {

    List<GoodsSelectLabelBean.ListBean> mSelectList  = new ArrayList<>();
    int mNum = 24;
    @Override
    protected void loadDatas() {
        mConfirmBtn.setVisibility(View.VISIBLE);
        mConfirmBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EventBus.getDefault().post(new RulesEvent(1, "notify-Have-Chosen")); //通知主页面刷新
                popFragment();
            }
        });
        Bundle bundle = getArguments();
        if (null!=bundle){
            mSelectList = bundle.getParcelableArrayList("mSelectList");
            Bundle b = new Bundle();
            b.putParcelableArrayList("data", (ArrayList<? extends Parcelable>) mSelectList);
            SetFragmentAndPage(mSelectList.size(),mNum,new GoodsLabelHaveChosenSelectChildFragment().getClass().getName(),b);
        }
    }
}
